package com.yc.web.model;

import com.yc.bean.Shoes;

import java.io.Serializable;

/*
* 购物项：表示购物车中的一个商品条目
*               商品对象
*               数量
*               小计
* */

public class CartItem implements Serializable {
    private Shoes shoes;        // => T<? extends Xxx>  泛型表示
    private int num;
    private double smallCount;//小计
    public double getSmallCount(){
        if (shoes!=null){
            smallCount = this.shoes.getSprice()*this.num;
        }
        return smallCount;
    }

    public Shoes getShoes() {
        return shoes;
    }

    public void setShoes(Shoes shoes) {
        this.shoes = shoes;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public void setSmallCount(double smallCount) {
        this.smallCount = smallCount;
    }
}
